/* Copyright (C) 2010 MoSync AB

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/

#ifndef MENUBUTTON_H_
#define MENUBUTTON_H_

#include <MAUI/Widget.h>
#include <MAUI/WidgetSkin.h>
#include <MAUI/Image.h>
#include <MAUI/Label.h>
#include <MAUI/Layout.h>
#include <MAUtil/String.h>
#include <MAUtil/Graphics.h>
#include <conprint.h>

using namespace MAUI;
using namespace MAUtil;

class MenuButton : public Widget
{
	public:
		MenuButton(int x, int y, int height, int width, Widget* parent);
		MenuButton(int x, int y, int height, int width, Widget* parent,
					MAHandle menuResource, MAHandle overlayResource,
					MAHandle highlightResource, const char* label);

		~MenuButton();

		void drawWidget();

		void setMenuImage(MAHandle menuimage);
		void setOverlayImage(MAHandle overlayimage);
		void setHighlightImage(MAHandle highlightimage);
		void setLabel(const char* label);

		void setFont(Font* fontResource);
		Font* getFont();

		void setSkin(WidgetSkin* skin);

		void setSelected(bool sel);

	private:
		MAHandle menuResource;
		MAHandle overlayResource;
		MAHandle highlightResource;
		String labelText;

		Image* overlayImage;
		Image* menuImage;
		Image* highlightImage;
		Label* buttonText;
		Layout* mainLayout;

		void createLayout();
};

#endif /* MENUBUTTON_H_ */
